A scanner or a similar type of device typically captures an image of a document while conveying the document using an imaging device, such as a line sensor, where imaging elements are one-dimensionally arrayed. If a foreign substance, such as paper dust, other fine particles, or glue, adheres to a glass surface of the imaging device, noise line extending in a document conveyance direction is generated in an image captured a document. Thus, a scanner or an image processing apparatus connected to a scanner, such as a personal computer, needs to detect and correct noise lines in images.
There have been disclosed: a conveyance device that conveys a document along a conveyance path, a CCD unit that reads a document at the reading position in the conveyance path, and an image reading apparatus that detects a shadow of a document formed on a reference plate based on image data output from the CCD unit. The image reading apparatus detects a white foreign substance at a position within a detected shadow with the shadow as the background (refer to Japanese Unexamined Patent Publication (Kokai) No 2013-70178).
An image processing apparatus desirably detects a noise line from an image with higher precision.
It is an object to provide an image processing apparatus, a control method, and a control method, and a computer-readable, non-transitory medium storing a computer program that can detect a noise line from an image with higher precision.
According to an aspect of the apparatus, there is provided an image processing apparatus. The image processing apparatus includes a processor for acquiring an input image of a document and a periphery of the document, extracting first edge pixels from the input image, detecting a document region based on the first edge pixels, detecting a shadow region from within a predetermined range outside of the document region, extracting noise pixels in the shadow region, detecting the noise pixels, a number of which connected with one another is equal to or more than a predetermined number, as a noise line, and correcting the document region of the input image based on a detection result of the noise line.
According to an aspect of the method, there is provided a control method of an image processing apparatus. The method includes acquiring an input image of a document and a periphery of the document, extracting first edge pixels from the input image, detecting a document region based on the first edge pixels, detecting a shadow region from within a predetermined range outside of the document region, extracting noise pixels in the shadow region, detecting the noise pixels, a number of which connected with one another is equal to or more than a predetermined number, as a noise line, and correcting the document region of the input image based on a detection result of the noise line.
According to an aspect of the computer-readable, non-transitory medium storing a computer program, there is provided a computer-readable, non-transitory medium storing a computer program, wherein the computer program causes an image processing apparatus to execute a process. The process includes acquiring an input image of a document and a periphery of the document, extracting first edge pixels from the input image, detecting a document region based on the first edge pixels, detecting a shadow region from within a predetermined range outside of the document region, extracting noise pixels in the shadow region, detecting the noise pixels, a number of which connected with one another is equal to or more than a predetermined number, as a noise line, and correcting the document region of the input image based on a detection result of the noise line.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims. It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention, as claimed.